# -*- coding: utf-8 -*-
# @Time    : 2022/7/23 17:19
# @Author  : xhf
# @Email   : xhf9309@163.com
# @File    : food.py
# @Software: PyCharm
from pages.base_page import BasePage
from selenium.webdriver.common.by import By

class FoodsPage(BasePage):
    '''食材页类'''
    '''定位器'''
    all_foods_locator = (By.ID,'com.gfeng.daydaycook:id/rightButton')   #所有食材定位器
    foods_list_locator = (By.ID,'com.gfeng.daydaycook:id/mTitle')   #买菜清单标题定位器
    all_foods_list_locator = (By.ID,'com.gfeng.daydaycook:id/mTitle')   #所有食材清单标题定位器


    def ele_all_foods(self):
        '''点击查看食物清单'''
        self.find_element(self.all_foods_locator).click()

    def assert_foods_list(self):
        '''获取买菜清单标题文本'''
        return self.find_element(self.foods_list_locator).text

    def assert_all_foods_list(self):
        '''获取所有食材标题文本'''
        return self.find_element(self.all_foods_list_locator).text

    def func_all_foods(self):
        '''聚合-食物清单'''
        self.ele_all_foods()